#ifndef __MYSQL_CD_H__
#define __MYSQL_CD_H__

#include "head.h"
#include "mysql_op.h"
#include "sendMsg.h"
#define err "Wrong dir! Please check!"
#define SQL_MAX 1024

// #include ""

char* Substring(char* ch,int pos,int length);
char* SearchTableData(MYSQL* mysql, char *column, char *Tname, char *where) ;
int addTableData(MYSQL *mysql, char *Tname, char *field, char *value);
int updateTableData(MYSQL *mysql, char *Tname, char *value, int uid);

void cdTable(MYSQL *mysql, int userid, int peerfd, char* pwd);
void typeCheck(MYSQL* mysql,int peerfd, int id);
void userCheck(MYSQL* mysql,int peerfd, int userid, int id);

#endif